import matplotlib.pyplot as plt
import numpy as np
from pyparsing import alphas

plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False

categories = ['A', 'B', 'C', 'D', 'E']
y = [25, 40, 30, 55, 15]


width = 0.35  # 每一个柱子的宽度

plt.figure(figsize=(12, 6))
plt.barh(categories, y, color='coral')
plt.title('水平柱状图示例')
plt.xlabel('类别')
plt.ylabel('数值')
# plt.legend()
plt.show()
